﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Future.FormBase
{
    /// <summary>
    /// 点击按钮触发Click事件,Click事件委托
    /// </summary>  
    public delegate void OnButtonClick(IButtonInfo sender);

    /// <summary>
    /// 定义按钮接口
    /// </summary>
    public interface IButtonInfo
    {
        string  Name { get; set; }
        string  Caption { get; set; }           //按钮标题
        Image   Image { get; set; }             //按钮图片
        int     Index { get; set; }             //显示顺序
        object  Button { get; }                 //按钮对象
        bool    Enable { get; set; }            //禁止/可用
        object  Tag { get; set; }               //自定义标记
        bool    Group { get; set; }             //分组
    }

    /// <summary>
    /// 系统按钮
    /// </summary>
    public interface ISystemButtons
    {
        IButtonInfo[] GetSystemButtons();

        /// <summary>
        /// 关闭窗体
        /// </summary>
        void DoClose(IButtonInfo button);
        /// <summary>
        /// 显示帮助
        /// </summary>
        void DoHelp(IButtonInfo button);
    }

    public interface IButtonList
    {
        void AddRange(IList buttons);

        void AddRange(IButtonInfo[] buttons);

        IButtonInfo GetButtonByName(string name);

        IButtonInfo[] ToArray();

        IList ToList();
    }
}
